package com.zlsy.thread.lock.lock;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author zhouliang
 * @date 2020/7/29 17:25
 */
public class PessimismOptimismLock {
    int a;

    public static void main(String[] args) {
        //乐观锁的加锁方式
        AtomicInteger integer = new AtomicInteger();
        integer.incrementAndGet();
    }

    public synchronized void testmethod() {
        a++;
    }
}
